package netty_mvc;

import com.alibaba.fastjson.JSONObject;
import org.netty.mvc.annotation.NettyController;
import org.netty.mvc.annotation.NettyControllerScans;

import java.io.UnsupportedEncodingException;
import java.net.URLEncoder;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.stream.Collectors;

/**
 * @Description:
 * @Author: yjj
 * @Date: 2023/10/31 14:03
 */
@NettyController
@NettyControllerScans(paths = {"netty_mvc.controller"})
public class Main {
    public static void main(String[] args) throws ParseException {
        List<String> list = new ArrayList<>();
        List<String> collect = list.stream().map(s -> s).collect(Collectors.toList());
        System.out.println(collect.contains("aaa"));


    }

    public static String getCurrentUser(String staffId, String staffName) {
        String currentUser = null;
        JSONObject currentUserInfo = new JSONObject();
        JSONObject staff = new JSONObject();
        staff.put("staffId", staffId);
        staff.put("staffName", staffName);
        currentUserInfo.put("staff", staff);
        try {
            currentUser = URLEncoder.encode(JSONObject.toJSONString(currentUserInfo), "utf-8");
        } catch (UnsupportedEncodingException e) {
            e.printStackTrace();
        }
        return currentUser;
    }
}
